#include "quesion58.h"
#include <iostream>

int quesion58::lengthOfLastWord(string s)
{
    int slen=s.length();
    int len=0;
    bool flag=false;
    for(int i=slen-1;i>=0;i--){
        if(s[i]==' '){
          if(flag) break;
          continue;
        }
        len++;
        flag=true;
    }
    return len;
}
